<!-- 17.Community_post_page -->
<div id="page-community">
  <header class="community-header">
    <div class="container">
      <nav class="sub-nav">
        {{breadcrumbs}}
        <div class="community-search">
          {{search}}
        </div>
      </nav>
    </div>
  </header>


  <div class="container">

    <div class="post-actions">
      <div class="post-to-community">
        {{link 'new_post' role='button'}}
      </div>
      <div class="post-header-subscribe">
        {{subscribe}}
      </div>
    </div>

    <article class="post {{#if post.featured}} post-featured {{/if}} {{#if post.pinned}} post-pinned {{/if}}">
      <h1 title="{{post.title}}">{{post.title}}</h1>

      <div class="post-info">
        <div class="post-avatar {{#if post.author.agent}} post-avatar-agent {{/if}}">
          <img src="{{post.author.avatar_url}}" alt="Avatar" />
        </div>
        <div class="post-meta">
          <strong class="post-author" title="{{post.author.name}}">
            {{#link 'user_profile' id=post.author.id}}
              {{post.author.name}}
			{{/link}}
          </strong>
          <div class="post-published meta">
            {{date post.created_at}}
          </div>
        </div>
      </div>

      <div class="content-body post-body">{{post.details}}</div>

      <div class="post-body-action post-actions">
        {{post.actions}}
      </div>
      <div class="post-voteAction">
        {{#with post}}
        <div class="vote-count">
          <span class="fa fa-thumbs-o-up"></span>
          {{vote 'sum' class="vote-sum"}}
        </div>
        <div class="vote-button">
          {{vote 'up' class='vote-up' selected_class='vote-voted'}}
        </div>

        {{/with}}
      </div>

    </article>

    <div class="post-comments">
      <h4 class="comment-heading">
        {{t 'comments_count' count=post.comment_count}}
      </h4>

      <div id="comments" class="comment-list">
        {{#each comments}}
        <div id="{{anchor}}" class="comment">

          <header class="comment-header">
            {{#if official}}
            <span class="comment-official">{{t 'official_comment'}}</span>
            {{/if}}
            {{#if pending}}
            <span class="comment-pending">{{t 'pending_approval'}}</span>
            {{/if}}
            <div class="comment-avatar {{#if author.agent}} comment-avatar-agent {{/if}}">
              <img src="{{author.avatar_url}}" alt="Avatar" />
            </div>
            <strong class="comment-author" title="{{author.name}}">
            {{#link 'user_profile' id=author.id}}
				{{author.name}}
			{{/link}}
            </strong>
            {{date created_at class='comment-published'}}
          </header>

          <div class="content-body comment-body">{{body}}</div>

          {{#if editor}}
            <div class="comment-edited meta">
              {{t 'comment_edited' editor_name=editor.name}} {{date edited_at timeago=true}}
            </div>
          {{/if}}

          <footer class="comment-footer">
            <span class="comment-actions">
              {{#with ticket}}
                <a href="{{url}}" target="_zendesk_lotus" class="escalation-badge">
                  #{{id}}
                </a>
              {{/with}}
              {{actions}}
            </span>
          </footer>

          <div class="comment-voteAction">

            <div class="vote-count">
              <span class="fa fa-thumbs-o-up"></span>
              {{vote 'sum' class="vote-sum"}}
            </div>
            <div class="vote-button">
              {{vote 'up' class='vote-up' selected_class='vote-voted'}}
            </div>
          </div>

        </div>
        {{/each}}
      </div>

      {{pagination}}

      <div class="comment-noLogin">{{comment_callout}}</div>

      {{#form 'comment' class='comment-form'}}
      <h5>コメントを書き込む</h5>
      <div class="comment-avatar">
        {{user_avatar class='user-avatar'}}
      </div>
      <div class="comment-container">
        {{wysiwyg 'body'}}
        <div class="comment-form-controls">
          {{checkbox 'official'}}
          {{label 'official'}}
          {{input type='submit'}}
        </div>
      </div>
      {{/form}}

    </div>
  </div>
</div>
